Skip to content

[paramiko] Update to 5.0.0#15907

Open
srittau wants to merge 4 commits into
python:mainfrom
srittau:paramiko-5.0.0
Open

[paramiko] Update to 5.0.0#15907
srittau wants to merge 4 commits into
python:mainfrom
srittau:paramiko-5.0.0

Conversation

@srittau

@srittau srittau commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Closes: #15749

@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review, I haven't reviewed stubs/paramiko/paramiko/pkey.pyi and onwards yet

Comment on lines +20 to +21
def from_file(cls, flo: Iterable[str]) -> Self: ...
def parse(self, file_obj: Iterable[str]) -> None: ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while it's true that any iterable of strings will work at runtime, the docstrings say that a file-like object is expected, and IO[str] does express that it should be an iterable of lines (rather than an iterable of words or characters).

I know you're generally opposed to using IO, though, and I share your philosophy there... not sure if there's a protocol that could also express "this needs to be an iterable of lines of source code" in the same way...

@srittau srittau Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, Iterable[str] is explicitly named for situations like this by the Python docs, but then that section was also written be me IIRC, so make of it what you will.

That said, maybe for now we could add a type alias to _typeshed and at some point this might become something more.

Comment thread stubs/paramiko/paramiko/ecdsakey.pyi Outdated
from paramiko.pkey import PKey
from paramiko.pkey import PKey, _HasReadlines

_VerifyKey: TypeAlias = Any # actually nacl.signing.VerifyKey

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pynacl looks to be fully typed and has a py.typed file. We could consider adding it to the stub_uploader allowlist and then adding it as a dependency of these stubs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just confirmed that paramiko depends on pynacl so that is viable, and probably wouldn't have much of a negative impact in practice. That said, considering that this looks to be the only place where the stubs pynacl and this is more of an internal module, an optional dependency like I suggested #15549 would be a better fit here, in my opinion.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

srittau added a commit to typeshed-internal/stub_uploader that referenced this pull request Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants